﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using HZ.Supervise.Model;
using System.Web.UI.DataVisualization.Charting;
using System.Drawing;
using HZ.Supervise.Model.Enum;

namespace HZ.Supervise.Web.Secondphase.ReportHospital
{
    public partial class ReportOfHospitalFirstLevel : BasePage
    {
        string strAreaId = String.Empty;
        DataTable dt = new DataTable();
        protected string HospitalTotal, DrugsTotal, FactoryTotal, DistributionTotal, OrderAmountTotal, DistributeCountTotal;
        protected string HospitalTotal_PS, DrugsTotal_PS, FactoryTotal_PS, DistributionTotal_PS, DistributionAmountTotal, StorageAmountTotal;
        HZ.Supervise.IBLL.IBLL_PreWarning pre = HZ.Supervise.BLLFactory.IBLL_PreWarning();
        public string sessionId = "";

        public ReportOfHospitalFirstLevel()
        {
            this.ModuleNo = Module.医院统计.ToString();
            this.PageOperateType = OperateType.医院统计查看.ToString();
        }
        string strwhere = "";
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                this.AreaControl1.InitAreaID = CurrentAccount.GetUser().Org.Area.AreaID;
                ViewState["query"] = URLUtil.GetSuperviseQueryFromURL(Request);
                //DataBindOfTable();
                Databind();
                BindMsChart();
                GetStatistics();
            }
        }

        void GetStatistics()
        {
            double purchaseAmountTotal = 0;//采购总金额
            double PurchaseCountTotal = 0;
            double wareHouseAmountTotal = 0;//入库总金额
            double wareHouseCountTotal = 0;
            double distributeAmountTotal = 0;//配送总金额
            double DistributeCountTotal = 0;//配送总数量

            double SellAmountTotal = 0;//销售总金额
            double ReturnAmountTotal = 0;//退货总金额
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["PurchaseAmountTotal"] != DBNull.Value) { purchaseAmountTotal += double.Parse(dt.Rows[i]["PurchaseAmountTotal"].ToString()); }
               
                    if (dt.Rows[i]["WareHouseAmountTotal"] != DBNull.Value) { wareHouseAmountTotal += double.Parse(dt.Rows[i]["WareHouseAmountTotal"].ToString()); }
                 
                    if (dt.Rows[i]["DistributeAmountTotal"] != DBNull.Value) { distributeAmountTotal += double.Parse(dt.Rows[i]["DistributeAmountTotal"].ToString()); }
                  
                    if (dt.Rows[i]["SellAmountTotal"] != DBNull.Value) { SellAmountTotal += double.Parse(dt.Rows[i]["SellAmountTotal"].ToString()); }
                    if (dt.Rows[i]["ReturnAmountTotal"] != DBNull.Value) { ReturnAmountTotal += double.Parse(dt.Rows[i]["ReturnAmountTotal"].ToString()); }

                }
                this.lblCount.Text = "<font style='font-weight:bold;'>统计：</font>采购总金额为:" + purchaseAmountTotal.ToString()
                    + ";配送总金额为:" + distributeAmountTotal.ToString() + ";入库总金额为:" + wareHouseAmountTotal.ToString() + ";销售总金额为:" + SellAmountTotal.ToString() + ";退货总金额为:" + ReturnAmountTotal.ToString();



                //this.lblOrderAmountTotal.Text = purchaseAmountTotal.ToString();

                //this.lblWareHouseAmountTotal.Text = wareHouseAmountTotal.ToString();

                //this.lblDistributionAmountTotal.Text = distributeAmountTotal.ToString();

                //this.lblWareHouseCountTotal.Text = wareHouseCountTotal.ToString();

                //this.lblOrderCountTotal.Text = PurchaseCountTotal.ToString();

                //this.lblDistributionCountTotal.Text = DistributeCountTotal.ToString();
            }

        }

        /// <summary>
        /// 绑定 增加用户控件
        /// by张雄  2011.5.16
        /// </summary>
        public void Databind()
        {
            strAreaId = this.AreaControl1.SelectedAreaID;      //获得当前用户控件的Id

            SuperviseQuery sq = (SuperviseQuery)ViewState["query"];//获取上个传值页面的传递过来的条件
            sessionId = Guid.NewGuid().ToString();

            SuperviseQuery query = new SuperviseQuery();
            query.HospitalName = sq.HospitalName;           
            Session[sessionId] = query;
            int t = 0;


            //SuperviseQuery sq = (SuperviseQuery)ViewState["query"];
            var model = new HZ.Data.QueryModel();
            HZ.Supervise.IBLL.IBLL_NewStat iNew = HZ.Supervise.BLLFactory.IBLL_NewStats();
           // int t = 0;


            model["SortFields"] = "DayTime";

            string month = "";
            if (DateTime.Now.AddMonths(-12).Month <= 9) month = "0" + DateTime.Now.AddMonths(-12).Month.ToString();
            else month = DateTime.Now.AddMonths(-12).Month.ToString();
            string timeFrom = DateTime.Now.AddMonths(-12).Year + "" + month;
            model["append"] = "DayTime > '" + timeFrom + "'";


            //判断医院是否有值 如有：
            if (!string.IsNullOrEmpty(query.HospitalName))
            {
                model["HospitalName"] = query.HospitalName;
                model["AreaId"] = AreaControl1.SelectedAreaID;
                ////判断当前是不是中心 =：是 <>：不是
                //if (AreaControl1.SelectedAreaID ==  CurrentAccount.GetUser().Org.Area.AreaID )
                //{
                //    model["HospitalName"] = sq.HospitalName;
                //}
                //else
                //{
                //    model["HospitalName"] = sq.HospitalName;
                //}
            }
            else
            {
                model["AreaId"] = AreaControl1.SelectedAreaID;
            }
           System.Data.DataTable dtt = iNew.ReportOfHospitalFirstLevel(model, strwhere, 1, 0, out t);

            dt = dtt.Copy();

            DataView dv = dtt.DefaultView;//不改，图表正序，列表倒序
            dv.Sort = "DayTime desc";
            dtt = dv.ToTable();

            //HZ.Supervise.Web.Function.AddColumn(dtt, "WareHouseRate", "SortSorce");
            //HZ.Supervise.Web.Function.ChangeRate_PS(dtt, "DistributeRate");

            gvwProcureCatalog.DataSource = dtt;
            gvwProcureCatalog.DataBind();

            //HZ.Supervise.Web.Function.Combine(this.gvwProcureCatalog, 0, 0);
            //HZ.Supervise.Web.Function.Combine(this.gvwProcureCatalog, 0, 7);

            //BindMsChart();
        }

        /// <summary>
        /// 医院统计导出
        /// 2011.4.8 张雄 create
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnExcel_Click(object sender, EventArgs e)
        {
            SuperviseQuery sq = (SuperviseQuery)ViewState["query"];
            int t = 0;
            HZ.Supervise.IBLL.IBLL_NewStat iNew = HZ.Supervise.BLLFactory.IBLL_NewStats();
            var model = new HZ.Data.QueryModel();
            model["AreaId"] = AreaControl1.SelectedAreaID;
            model["SortFields"] = "DayTime";
            model["HospitalName"] = sq.HospitalName;
            string month = "";
            if (DateTime.Now.AddMonths(-12).Month <= 9) month = "0" + DateTime.Now.AddMonths(-12).Month.ToString();
            else month = DateTime.Now.AddMonths(-12).Month.ToString();
            string timeFrom = DateTime.Now.AddMonths(-12).Year + "" + month;
            model["append"] = "DayTime > '" + timeFrom + "'";

            System.Data.DataTable dtt = iNew.ReportOfHospitalFirstLevel(model, strwhere, 1, 0, out t);
            HZ.Supervise.IBLL.IExecuteContext ie = HZ.Supervise.BLLFactory.ExecuteContext();
            dt = dtt.Copy();

            DataView dv = dtt.DefaultView;

            dv.Sort = "DayTime desc";

            dtt = dv.ToTable();

            //HZ.Supervise.Web.Function.AddColumn(dtt, "WareHouseRate", "SortSorce");
            //HZ.Supervise.Web.Function.ChangeRate_PS(dtt, "DistributeRate");

            HZ.Excel.ExcelHelper.ExportDataForWeb(dtt, this.gvwProcureCatalog);

        }


        /// <summary>
        /// 图表绑定,曲线图 
        /// by 张雄
        /// </summary>
        private void BindMsChart()
        {
            //空为初始页
            if (dt.Rows.Count > 0)
            {
                string monch = "";//月份     

                #region 左图

                //***************** 日常采购 *****************/
                Series series1 = new Series("采购金额");
                series1.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), "Column", true);
                series1.IsValueShownAsLabel = true;
                series1.MarkerStyle = MarkerStyle.Diamond;
                series1.BorderWidth = 1;
                series1.ShadowOffset = 1;
                series1.ToolTip = "采购金额: #VAL{c} 万元";
                

                series1.Label = "#VAL{F}";
                series1.Color = Color.FromArgb(243, 84, 37);


                //***************** 临时采购 *****************/
                Series series2 = new Series("配送金额");
                series2.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), "Column", true);
                series2.IsValueShownAsLabel = true;
                series2.MarkerStyle = MarkerStyle.Diamond;
                series2.BorderWidth = 1;
                
                series2.ShadowOffset = 1;
                series2.ToolTip = "配送金额: #VAL{c}  万元";

                series2.Label = "#VAL{F}";
                series2.Color = Color.FromArgb(243, 152, 0);


                //***************** 应急采购 *****************/
                Series series3 = new Series("入库金额");
                series3.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), "Column", true);
                series3.IsValueShownAsLabel = true;
                series3.MarkerStyle = MarkerStyle.Diamond;
                series3.BorderWidth = 1;
                series3.ShadowOffset = 1;
                series3.ToolTip = "入库金额: #VAL{c} 万元";

                series3.Label = "#VAL{F}";
                series3.Color = Color.FromArgb(143, 195, 31);

                Series series4 = new Series("销售金额");
                series4.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), "Column", true);
                series4.IsValueShownAsLabel = true;
                series4.MarkerStyle = MarkerStyle.Diamond;
                series4.BorderWidth = 1;
                series4.ShadowOffset = 1;
                series4.ToolTip = "销售金额: #VAL{c} 万元";

                series4.Label = "#VAL{F}";
                series4.Color = Color.FromArgb(137, 201, 151);

                Series series5 = new Series("退货金额");
                series5.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), "Column", true);
                series5.IsValueShownAsLabel = true;
                series5.MarkerStyle = MarkerStyle.Diamond;
                series5.BorderWidth = 1;
                series5.ShadowOffset = 1;
                series5.ToolTip = "退货金额: #VAL{c} 万元";

                series5.Label = "#VAL{F}";
                series5.Color = Color.FromArgb(88, 219, 213);



                #endregion

                #region 右图

                ////***************** 日常采购  ****************/
                //Series series5 = new Series("日常采购");
                //series5.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), Drpmode.SelectedValue, true);
                //series5.IsValueShownAsLabel = true;
                //series5.MarkerStyle = MarkerStyle.Diamond;
                //series5.BorderWidth = 1;
                //series5.ShadowOffset = 1;


                //series5.Label = "#VAL{F}";
                //series5.Color = Color.FromArgb(74, 172, 197);

                ////***************** 临时采购  ****************/
                //Series series6 = new Series("临时采购");
                //series6.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), Drpmode.SelectedValue, true);
                //series6.IsValueShownAsLabel = true;
                //series6.MarkerStyle = MarkerStyle.Diamond;
                //series6.BorderWidth = 1;
                //series6.ShadowOffset = 1;


                //series6.Label = "#VAL{F}";
                //series6.Color = Color.FromArgb(129, 101, 162);

                ////***************** 应急采购  ****************/
                //Series series7 = new Series("应急采购");
                //series7.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), Drpmode.SelectedValue, true);
                //series7.IsValueShownAsLabel = true;
                //series7.MarkerStyle = MarkerStyle.Diamond;
                //series7.BorderWidth = 1;
                //series7.ShadowOffset = 1;


                //series7.Label = "#VAL{F}";
                //series7.Color = Color.FromArgb(192, 80, 78);
                #endregion

                #region 绑定值，分3块日常采购，临时采购，应急采购（数量，采购金额）
          

                for (int i = 0; i < dt.Rows.Count; i++) //添加数据
                {

                    // serise1，series5 日常采购
                   
                        // serise1，series5 日常采购
                      
                       
                            //金额
                            series1.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), (double.Parse(dt.Rows[i]["PurchaseAmountTotal"].ToString()) / 10000).ToString());

                            series2.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), (double.Parse(dt.Rows[i]["DistributeAmountTotal"].ToString()) / 10000).ToString());

                            series3.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), (double.Parse(dt.Rows[i]["WareHouseAmountTotal"].ToString()) / 10000).ToString());

                            series4.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), (double.Parse(dt.Rows[i]["sellAmountTotal"].ToString()) / 10000).ToString());

                            series5.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), (double.Parse(dt.Rows[i]["ReturnAmountTotal"].ToString()) / 10000).ToString());

                            ////配送率
                            //series5.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), (double.Parse(dt.Rows[i]["DistributeRate"].ToString())).ToString());

                            monch = dt.Rows[i]["DayTime"].ToString();

                            //series2.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), 0);
                            //series2.Points[s1].ToolTip = "0";

                            //series6.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), 0);
                            //series6.Points[s1].ToolTip = "0";

                            //series3.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), 0);
                            //series3.Points[s2].ToolTip = "0";

                            //series7.Points.AddXY(HZ.Supervise.Web.Function.FormartDate(dt.Rows[i]["DayTime"].ToString()), 0);
                            //series7.Points[s2].ToolTip = "0";
                     
                        // serise2，series6 临时采购
                        

                        //s0++;
                        //s1++;
                        //s2++;

                             

                }




                #endregion

                #region 数据绑定到图
                //清空Serise 避免确定按钮和下拉框同时绑定图表
                ChartPurchasing.Series.Clear();

                ChartInStorage.Series.Clear();


                ChartPurchasing.Series.Add(series1);

                //ChartInStorage.Series.Add(series5);

                ChartPurchasing.Series.Add(series2);

                //ChartInStorage.Series.Add(series6);

                ChartPurchasing.Series.Add(series3);
                ChartPurchasing.Series.Add(series4);
                ChartPurchasing.Series.Add(series5);
                //ChartInStorage.Series.Add(series7);
                #endregion

                #region 两张图片属性
                
                //ChartPurchasing.ChartAreas["ChartHosPurchasing"].AxisX.IsMarginVisible = true;
                ChartPurchasing.ChartAreas["ChartHosPurchasing"].Area3DStyle.Enable3D = true;

                //ChartInStorage.ChartAreas["ChartHosStorage"].AxisX.IsMarginVisible = true;
                //ChartInStorage.ChartAreas["ChartHosStorage"].Area3DStyle.Enable3D = false;


                //ChartPurchasing.ChartAreas["ChartHosPurchasing"].AxisX.MajorGrid.Interval = 1;
                //ChartPurchasing.ChartAreas["ChartHosPurchasing"].AxisX.LineWidth = 1;
                //ChartPurchasing.ChartAreas["ChartHosPurchasing"].AxisY.LineWidth = 1;

                //ChartInStorage.ChartAreas["ChartHosStorage"].AxisX.MajorGrid.Interval = 1;
                //ChartInStorage.ChartAreas["ChartHosStorage"].AxisX.LineWidth = 1;
                //ChartInStorage.ChartAreas["ChartHosStorage"].AxisY.LineWidth = 1;

                ChartPurchasing.ChartAreas["ChartHosPurchasing"].AxisY.Title = "金额（万元）";
                ChartPurchasing.ChartAreas["ChartHosPurchasing"].AxisX.Title = "日期";

                //ChartInStorage.ChartAreas["ChartHosStorage"].AxisY.Title = "配送率";
                //ChartInStorage.ChartAreas["ChartHosStorage"].AxisX.Title = "日期";
                #endregion

                #region 分组
                ChartPurchasing.Series["采购金额"]["StackedGroupName"] = "Group1";
                ChartPurchasing.Series["配送金额"]["StackedGroupName"] = "Group1";
                ChartPurchasing.Series["入库金额"]["StackedGroupName"] = "Group1";
                ChartPurchasing.Series["销售金额"]["StackedGroupName"] = "Group1";
                ChartPurchasing.Series["退货金额"]["StackedGroupName"] = "Group1";

                ChartPurchasing.Series["采购金额"]["DrawingStyle"] = "Cylinder";
                ChartPurchasing.Series["配送金额"]["DrawingStyle"] = "Cylinder";
                ChartPurchasing.Series["入库金额"]["DrawingStyle"] = "Cylinder";
                ChartPurchasing.Series["销售金额"]["DrawingStyle"] = "Cylinder";
                ChartPurchasing.Series["退货金额"]["DrawingStyle"] = "Cylinder";

                ChartPurchasing.Series["采购金额"]["PointWidth"] = "0.6";
                ChartPurchasing.Series["配送金额"]["PointWidth"] = "0.6";
                ChartPurchasing.Series["入库金额"]["PointWidth"] = "0.6";
                ChartPurchasing.Series["销售金额"]["PointWidth"] = "0.6";
                ChartPurchasing.Series["退货金额"]["PointWidth"] = "0.6";


                //ChartInStorage.Series["日常采购"]["StackedGroupName"] = "Group2";
                //ChartInStorage.Series["临时采购"]["StackedGroupName"] = "Group2";
                //ChartInStorage.Series["应急采购"]["StackedGroupName"] = "Group2";

                //ChartInStorage.ResetAutoValues();
                ChartPurchasing.ResetAutoValues();
                #endregion
                //lblnull.Visible = false;
                btnExcel.Visible = true;
                divShow.Visible = true;
               // tabShow.Visible = true;

            }
            else
            {
                this.btnExcel.Visible = false;
                this.divShow.Visible = false;
                this.ChartInStorage.Visible = false;
                this.ChartPurchasing.Visible = false;
                //this.tabShow.Visible = false;
                //lblnull.Visible = true;
                //this.divTable.Visible = false;
            }
        }



        protected void gvwProcureCatalog_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "DirectByDetail")
            {
                string sessionid = Guid.NewGuid().ToString();
                SuperviseQuery query = (SuperviseQuery)ViewState["query"];
                try
                {
                    query.Mid = e.CommandArgument.ToString();
                    query.AreaID = AreaControl1.SelectedAreaID.ToString();
                }
                catch { }
                Session[sessionid] = query;
                string url = "";
                if (string.IsNullOrEmpty(query.HospitalName))
                {
                    url = "HospitalOfMonth.aspx";
                }
                else   //按医院查询
                {
                    url = "HospitalCurrentGoodsList.aspx";
                }
                Response.Redirect(string.Format("{0}?sessionid={1}", url, sessionid));
            }
        }



        //private void DataBindOfTable()
        //{
        //    HZ.Supervise.IBLL.IExecuteContext ie = HZ.Supervise.BLLFactory.ExecuteContext();
        //    {
        //        SuperviseQuery sq = (SuperviseQuery)ViewState["query"];
        //        var model = new HZ.Data.QueryModel();
        //        model["HospitalName"] = sq.HospitalName;
        //        if (this.AreaControl1.SelectedAreaID != "22" && this.AreaControl1.SelectedAreaID != "510000")//全部省过滤地区，速度快8秒
        //        {
        //            model["AreaID"] = this.AreaControl1.SelectedAreaID;
        //        }

        //        DataTable dtChart1 = ie.GetSuperviseChart1(model);

        //        if (dtChart1.Rows.Count > 0)
        //        {
        //            if (dtChart1.Rows[0]["HospitalCount"] != DBNull.Value) { this.lblHospitalTotal.Text = string.Format("{0}个", dtChart1.Rows[0]["HospitalCount"].ToString()); }
        //            if (dtChart1.Rows[0]["ProcureCatalogCount"] != DBNull.Value) { this.lblDrugsTotal.Text = string.Format("{0}个", dtChart1.Rows[0]["ProcureCatalogCount"].ToString()); }
        //            if (dtChart1.Rows[0]["CompanySCCount"] != DBNull.Value) { this.lblFactoryTotal.Text = string.Format("{0}个", dtChart1.Rows[0]["CompanySCCount"].ToString()); }
        //            if (dtChart1.Rows[0]["CompanyPSCount"] != DBNull.Value) { this.lblDistributionTotal.Text = string.Format("{0}个", dtChart1.Rows[0]["CompanyPSCount"].ToString()); }

        //        }


        //    }
        //}

        protected void gvwProcureCatalog_RowCreated(object sender, GridViewRowEventArgs e)
        {
            switch (e.Row.RowType)
            {
                case DataControlRowType.Header:

                    TableCellCollection tcHeader = e.Row.Cells;
                    tcHeader.Clear();

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[0].Attributes.Add("colspan", "6"); //跨Column
                    tcHeader[0].Attributes.Add("bgcolor", "LightSteelBlue");
                    SuperviseQuery sq = (SuperviseQuery)ViewState["query"];
                    tcHeader[0].Text = (sq.HospitalName == null ? "医院汇总统计" : sq.HospitalName) + "</th></tr><tr>";

                    //第2行表头
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[1].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[1].Text = "日期";

                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[2].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[2].Text = "采购类型";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[2].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[2].Text = "采购总金额";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[3].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[3].Text = "配送总金额";

                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[5].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[5].Text = "配送率";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[4].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[4].Text = "入库总金额";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[5].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[5].Text = "销售总金额";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[6].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[6].Text = "退货总金额";

                    //tcHeader.Add(new TableHeaderCell());//2011-0329 ml 取消补贴
                    //tcHeader[7].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[7].Text = "入库率";

                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[7].Attributes.Add("bgcolor", "Khaki");
                    //tcHeader[7].Text = "操作";

                    break;
            }

        }

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            Databind();
            BindMsChart();
            //DataBindOfTable();
            GetStatistics();
        }

        protected void Drpmode_SelectedIndexChanged(object sender, EventArgs e)
        {
            Databind();
            BindMsChart();
            GetStatistics();
        }
    }
}
